package cn.cloud9.controller;

import cn.cloud9.log.MyLog;
import cn.cloud9.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author OnCloud9
 * @description
 * @project MyAPP
 * @date 2022年04月17日 15:46
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    //HelloService在我们自定义的starter中已经完成了自动配置，所以此处可以直接注入
    @Resource
    private HelloService helloService;

    @MyLog
    @GetMapping("/say")
    public String sayHello(){
        return helloService.sayHello();
    }
}
